package com.sf.fy.uav.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sf.fy.uav.common.response.order.ProductTypeResp;
import com.sf.fy.uav.common.utils.BeanUtil;
import com.sf.fy.uav.common.utils.Rs;
import com.sf.fy.uav.entity.ProductType;
import com.sf.fy.uav.mapper.ProductTypeMapper;
import com.sf.fy.uav.service.IProductTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品类型表 服务实现类
 * </p>
 *
 * @author LTQ
 * @since 2024-11-26
 */
@Service
public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, ProductType> implements IProductTypeService {

    @Override
    public List<ProductTypeResp> getProductType() {
        List<ProductType> list = this.list(new LambdaQueryWrapper<ProductType>().eq(ProductType::getEnable, 1).orderByAsc(ProductType::getSort));
        List<ProductTypeResp> productTypeResps = BeanUtil.copyProperties(list, ProductTypeResp.class);
        return productTypeResps;
    }
}
